<?php
namespace PsiFramework\Applications\AlloMediaAdmin\Classes\Actions;

import("Classes.Actions.AbstractAction");
import("Classes.Util.HTTP.AuthenticationManager");
import("Classes.Factory.DAOFactory");

use \PsiFramework\Classes\Actions\AbstractAction;
use \PsiFramework\Classes\Util\HTTP\AuthenticationManager;
use \PsiFramework\Classes\Util\Parameters\Action\ActionParameters;
use \PsiFramework\Classes\Factory\DAOFactory;

/**
 * PsiFramework
 * Php Simple Framework
 *
 * @author Rémi San
 * @version beta
 */

/**
 * Classe d'action de l'index
 *
 * @package Actions.Pages
 */
class AlloMediaUserEdit extends AbstractAction
{

    public function __construct(ActionParameters $actionParameters)
    {
        parent::__construct($actionParameters);
    }

    /**
     * The main function of the method which is called every time
     * an action is created by the front controller.
     *
     */
    public function execute()
    {
        parent::execute();

        $user = AuthenticationManager::getInstance()->getAuthenticatedUser();
        $userDao = DAOFactory::getDAO('User');
        $user = $userDao->retrieveByPk($user->getId());
        $this->_response->setAttribute("user", $user);

        $this->findForward('success');
    }
}
